//
//  Ship.h
//  SpaceStorm
//
//  Created by 祥 雍 on 13-4-20.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//
//  船舰的模型类

#import "cocos2d.h"
#import "ShipView.h"
#import "ShipModelInfo.h"
#import "Weapon.h"
#import "ShipVo.h"
#import "ShipFSM.h"

@interface Ship : CCNode
{
    int _shipId;
    struct ShipProp _prop;  //属性
    BOOL _isTeam;
    
    ShipView* _view; 
    CCArray* _weaponList;
    
    ShipModelInfo* modelInfo;
    CGPoint _targetPoint;   //目标点
    
    
}

#pragma mark -
#pragma mark 创建及初始化
+(id) shipWithId:(int)shipId;
-(id) initWithId:(int)shipId;
+(id) shipWithVo:(ShipVo*)shipVo;
-(id) initWithVo:(ShipVo*)shipVo;
+(id) shipWithMonsterId:(int)monsterId;
-(id) initWithMonsterId:(int)monsterId;

#pragma mark -
#pragma mark 挂载系统
-(void) addAttackWeapon:(int)equipId index:(int)index;
-(void) addAttackWeapons:(NSMutableDictionary*)equipIds;
-(void) addDefenseWeapon:(int)equipId index:(int)index;
-(void) addDttackWeapons:(NSMutableDictionary*)equipIds;
-(void) addServoSystem:(int)equipId;
-(void) addServoSystems:(NSMutableDictionary*)equipIds;
-(void) addAirplane:(int)equipId;
-(void) addAirplanes:(NSMutableDictionary*) equipIds;

#pragma mark -
#pragma mark 动作及操作
-(void) updateLogic:(ccTime)delta;
-(void) moveTo:(CGPoint)toPoint;
-(void) moveToNormal:(CGPoint)toPoint;
-(void) moveToBezier:(CGPoint)toPoint;

-(void) doATask;
-(void) doChangeSpeedMove;


#pragma mark -
#pragma mark 船舰的属性
@property (readwrite) int shipId;                          //船舰的id
@property (readwrite) struct ShipProp prop;                //属性
@property (readwrite) BOOL isTeam;                         //是不是队伍
@property (readwrite, retain) ShipView* view;              //船舰的视图
@property (readwrite, retain) CCArray* weaponList;         //武器的数组
@property (readwrite, retain) ShipFSMManager* fsmManage;   //船舰的状态机

@end
